package com.alexmullans.mytvcompanion;

import java.awt.EventQueue;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.GridLayout;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JComboBox;
import java.awt.Insets;
import java.awt.Font;
import javax.swing.JTextField;
import javax.swing.JSplitPane;
import javax.swing.JButton;

public class MyTVCompanion {

	private JFrame frame;
	private MyTVController controller;
	private JTextField textField;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					MyTVCompanion window = new MyTVCompanion();
					window.frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public MyTVCompanion() {
		initialize();
		controller = new MyTVController();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frame = new JFrame();
		frame.setBounds(100, 100, 450, 300);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setTitle("Settings | MyTVCompanion");
		GridBagLayout gridBagLayout = new GridBagLayout();
		gridBagLayout.rowWeights = new double[] { 0.0, 1.0 };
		gridBagLayout.columnWeights = new double[] { 1.0, 1.0 };
		frame.getContentPane().setLayout(gridBagLayout);
		GridBagConstraints c = new GridBagConstraints();
		c.fill = GridBagConstraints.HORIZONTAL;

		JLabel lblMyWatchedShows = new JLabel("My watched shows");
		lblMyWatchedShows.setFont(lblMyWatchedShows.getFont().deriveFont(
				lblMyWatchedShows.getFont().getStyle() | Font.BOLD,
				lblMyWatchedShows.getFont().getSize() + 5f));
		c.gridx = 1;
		c.gridy = 0;

		JLabel lblFindNewShows = new JLabel("Find new shows");
		lblFindNewShows.setFont(lblFindNewShows.getFont().deriveFont(
				lblFindNewShows.getFont().getStyle() | Font.BOLD,
				lblFindNewShows.getFont().getSize() + 5f));
		GridBagConstraints gbc_lblFindNewShows = new GridBagConstraints();
		gbc_lblFindNewShows.insets = new Insets(0, 0, 5, 5);
		gbc_lblFindNewShows.gridx = 0;
		gbc_lblFindNewShows.gridy = 0;
		frame.getContentPane().add(lblFindNewShows, gbc_lblFindNewShows);
		GridBagConstraints gbc_label = new GridBagConstraints();
		gbc_label.insets = new Insets(0, 0, 5, 0);
		gbc_label.gridx = 1;
		gbc_label.gridy = 0;
		frame.getContentPane().add(lblMyWatchedShows, gbc_label);
		
		JSplitPane splitPane = new JSplitPane();
		splitPane.setContinuousLayout(true);
		splitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
		GridBagConstraints gbc_splitPane = new GridBagConstraints();
		gbc_splitPane.insets = new Insets(0, 0, 5, 5);
		gbc_splitPane.fill = GridBagConstraints.BOTH;
		gbc_splitPane.gridx = 0;
		gbc_splitPane.gridy = 1;
		frame.getContentPane().add(splitPane, gbc_splitPane);
		
		textField = new JTextField();
		splitPane.setLeftComponent(textField);
		textField.setColumns(10);
		
		JList list_1 = new JList();
		splitPane.setRightComponent(list_1);

		JList<String> list = new JList<String>();
		GridBagConstraints gbc_list = new GridBagConstraints();
		gbc_list.insets = new Insets(0, 0, 5, 0);
		gbc_list.fill = GridBagConstraints.BOTH;
		gbc_list.gridx = 1;
		gbc_list.gridy = 1;
		frame.getContentPane().add(list, gbc_list);
				
				JButton btnNewButton = new JButton("Watch selected shows");
				GridBagConstraints gbc_btnNewButton = new GridBagConstraints();
				gbc_btnNewButton.fill = GridBagConstraints.HORIZONTAL;
				gbc_btnNewButton.insets = new Insets(0, 0, 0, 5);
				gbc_btnNewButton.gridx = 0;
				gbc_btnNewButton.gridy = 2;
				frame.getContentPane().add(btnNewButton, gbc_btnNewButton);
		
				
				JButton btnSaveShows = new JButton();
				btnSaveShows.setText("Save shows");
				GridBagConstraints gbc_btnSaveShows = new GridBagConstraints();
				gbc_btnSaveShows.fill = GridBagConstraints.HORIZONTAL;
				gbc_btnSaveShows.gridx = 1;
				gbc_btnSaveShows.gridy = 2;
				frame.getContentPane().add(btnSaveShows, gbc_btnSaveShows);
		
	}
}
